<template>
  <div>
    <div class="title">
      <div class="diyi"></div>
      <font>医生管理</font>
    </div>
    <div class="dier">
      <el-form ref="form" :model="form" label-width="70px">
        <table border="0" width="100%" height="60px">
          <tr align="right">
            <td width="60px" >
              <font class="font1">所属机构</font>
            </td>
            <td width="230px" align="left">
              <el-select v-model="value1" placeholder="请选择">
                <el-option
                  v-for="item in list1"
                  :label="item.organization_name"
                  :key="item.organization_id"
                  :value="item.organization_id"
                >
                </el-option>
              </el-select>
            </td>
            <td>
              <font class="font1">所属团队</font>
            </td>
            <td width="230px" align="left">
              <el-select v-model="value2" placeholder="请选择">
                <el-option
                  v-for="item in list2"
                  :label="item.team_name"
                  :key="item.team_id"
                  :value="item.team_id"
                >
                </el-option>
              </el-select>
            </td>
            <td width="70px">
              <font class="font1">医生标签&nbsp;&nbsp;</font>
            </td>
            <td width="230px" align="left">
              <el-select v-model="value" placeholder="请选择">
                <el-option
                  v-for="item in list"
                  :label="item.label"
                  :key="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </td>
            
            
            <td align="right" width="120px">
              <el-button type="primary" @click="adddoctor()">新增医生</el-button>
            </td>
            <td align="right">
              <el-button type="primary" >导出</el-button>
            </td>
          </tr>
        </table>
        <table border="0" width="100%">
          <tr align="right">
            
            <td width="380px">
              <el-input v-model="name"></el-input><i class="el-icon-search tututt" @click="onSubmitDoctor()"></i>
            </td>
            <td>
            </td>
          </tr>
        </table>
      </el-form>
    </div>
  </div>
</template>

<script>
import axios from "axios";
axios.defaults.baseURL = "http://localhost:8080";
export default {
  data() {
    return {
      list: [
        {
          value: 1,
          label: "慢病护理",
        },
        {
          value: 2,
          label: "高血压",
        },
        {
          value: 3,
          label: "高血糖",
        },
        
      ],
      value: "", //标签

      list1: "", //所属机构
      value1: "",

      list2: "",
      value2: "", //所属团队

      name: "",//输入框
    };
  },
  methods: {
    adddoctor(){
      this.$router.push({
        path:'/datas11',
      });
    },
    onSubmitDoctor() {
        // this.value医生标签  this.value1所属机构  this.value2所属团队
        this.$emit("subFn2", this.value1, this.value2, this.value,this.name);
    },
    query1() {
      axios({
        url: "/sign/getOrganizationList",
        method: "GET",
      }).then((res) => {
        this.list1 = res.data; //把值传到list里面
      });
    },
    query2() {
      axios({
        url: "/data/getTeamList",
        method: "GET",
      }).then((res) => {
        this.list2 = res.data; //把值传到list里面
      });
    },
  },
  created() {
    this.query1();
    this.query2();
  },
};
</script>

<style>
.tututt{
  position: relative;
  top: -30px;
  left: -10px;
}
.tubiao {
  float: left;
  margin-top: -10px;
  margin-left: 10px;
  /* z-index: 100; */
}
.table2 {
  float: left;
  margin-left: 2%;
}
.table1 {
  float: left;
  /* margin-top: 1%; */
  margin-left: 2%;
}
.font1 {
  font-size: 13px;
  color: #999999;
}
.dier {
  width: 96%;
  height: 110px;
  font-size: 18px;
  /* background: rgb(174, 63, 63); */
  margin-top: 1%;
}
.diyi {
  width: 6px;
  height: 20px;
  background-color: #2984f8;
  border-radius: 5px;
  margin-left: 2%;
  display: inline-block;
  margin-right: 10px;
}
.title {
  width: 100%;
  height: 40px;
  font-size: 18px;
  display: flex;
  align-items: center;
  /* background: rgb(255, 214, 214); */
}
</style>